
package com.springboot.stelleroid.logger.slf4j;


import com.springboot.stelleroid.logger.Level;
import com.springboot.stelleroid.logger.Logger;
import com.springboot.stelleroid.logger.LoggerAdapter;
import org.slf4j.spi.LocationAwareLogger;

import java.io.File;
/**
 * @author leiliang
 */
public class Slf4jLoggerAdapter implements LoggerAdapter {

    private Level level;
    private File file;

    @Override
    public Logger getLogger(String key) {
        return new Slf4jLogger(org.slf4j.LoggerFactory.getLogger(key));
    }

    @Override
    public Logger getLogger(Class<?> key) {
        return new Slf4jLogger(org.slf4j.LoggerFactory.getLogger(key));
    }


    /**
     * <p>You may need to go and get for {@link LocationAwareLogger} it?<p/>
     * <p>But it is actually log4j,May be care about the NPE ?<p/>
     * @return com.springboot.stelleroid.logger.Level
     */
    @Override
    public Level getLevel() {
        return level;
    }

    @Override
    public void setLevel(Level level) {
        this.level = level;
    }

    @Override
    public File getFile() {
        return file;
    }
}
